/**
 * Project: apollo-base-dal
 * 
 * File Created at 2017年2月21日
 * 
 * Copyright 2015-2016 dx.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DongXue software Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with dx.com.
 */
package com.dx.pf.dal.conf.rule.entity;

import java.io.Serializable;
import java.util.List;

import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;

/** 
* @ClassName: ShardRule 
* @Description: 分片规则</br>
* 一个分片的包含多个数据库规则，或者多个表规则：</br>
* 分片情况：
* 1、一个库分片规则，对应一个或者多个分表规则
* 2、一个库分片规则
* 3、一个或者多个分表规则
* @author wuzhenfang(wzfbj2008@163.com)
* @date 2017年2月21日 上午9:30:05 
* @version V1.0 
*/
public class ShardRuleConf implements Serializable{
	
	private static final long serialVersionUID = -3997294863301326629L;

	/**分片规则ID*/
	private String ruleId;
	
	/**DB分片规则*/
	private List<DBRuleConf> dbRuleConfs;
	
	/**TB分片规则*/
	private List<TBRuleConf> tbRuleConfs;
	
	/**db分片规则对应*/
	private BiMap<String,String> dbFieldMap = HashBiMap.create(80);
	
	/**db分片规则对应*/
	private BiMap<String,String> tbFieldMap = HashBiMap.create(16);

	/**
	 * @return the ruleId
	 */
	public String getRuleId() {
		return ruleId;
	}

	/**
	 * @param ruleId the ruleId to set
	 */
	public void setRuleId(String ruleId) {
		this.ruleId = ruleId;
	}

	/**
	 * @return the dbRuleConfs
	 */
	public List<DBRuleConf> getDbRuleConfs() {
		return dbRuleConfs;
	}

	/**
	 * @param dbRuleConfs the dbRuleConfs to set
	 */
	public void setDbRuleConfs(List<DBRuleConf> dbRuleConfs) {
		this.dbRuleConfs = dbRuleConfs;
	}

	/**
	 * @return the tbRuleConfs
	 */
	public List<TBRuleConf> getTbRuleConfs() {
		return tbRuleConfs;
	}

	/**
	 * @param tbRuleConfs the tbRuleConfs to set
	 */
	public void setTbRuleConfs(List<TBRuleConf> tbRuleConfs) {
		this.tbRuleConfs = tbRuleConfs;
	}

	/**
	 * @return the dbFieldMap
	 */
	public BiMap<String, String> getDbFieldMap() {
		return dbFieldMap;
	}

	/**
	 * @param dbFieldMap the dbFieldMap to set
	 */
	public void setDbFieldMap(BiMap<String, String> dbFieldMap) {
		this.dbFieldMap = dbFieldMap;
	}

	/**
	 * @return the tbFieldMap
	 */
	public BiMap<String, String> getTbFieldMap() {
		return tbFieldMap;
	}

	/**
	 * @param tbFieldMap the tbFieldMap to set
	 */
	public void setTbFieldMap(BiMap<String, String> tbFieldMap) {
		this.tbFieldMap = tbFieldMap;
	}

	
}
